﻿package system.base;

import framework.core.*;
import system.data.*;

/*
 Author    :Benny
 CreateTime:2008-05-19 11:09:58
 */
public class BusMaterialAccount extends BusMaterialAccountBase {

    // ----system generated start----//
    public BusMaterialAccount() {

    }

    private static void delete(DBConnection con, String id) throws Exception {
        Conditions conditions = new Conditions();

        conditions.add(ID, id);

        delete(con, TABLE_NAME, conditions);
    }

    public static BusMaterialAccount fetch() {
        return new BusMaterialAccount();
    }

    public static BusMaterialAccount copy(BusMaterialAccount srcObj) {
        BusMaterialAccount obj = fetch();
        obj.copyBase(srcObj);
        return obj;
    }

    public static BusMaterialAccount fetch(DBConnection con, String id) throws Exception {
        Conditions conditions = new Conditions();

        conditions.add(ID, id);

        return fetch(con, conditions);
    }

    public static BusMaterialAccount fetch(DBConnection con, Conditions conditions) throws Exception {
        DBResult result = null;
        try {
            result = DBEngine.doSelect(con, "select * from " + TABLE_NAME, conditions);
            java.sql.ResultSet rs = result.getRs();
            BusMaterialAccount obj = null;
            if (rs.next()) {
                obj = fetch(rs);
            }
            return obj;
        } finally {
            if (result != null)
                result.clear();
        }
    }

    public static BusMaterialAccount fetch(java.sql.ResultSet rs) throws Exception {
        BusMaterialAccount obj = new BusMaterialAccount();
        obj.initObject(rs);
        return obj;
    }

    protected void getUnique(DBConnection con) throws Exception {
        setId(DBEngine.getId(con));
    }

    // ----system generated end----//

    // ----add by Benny start----//

    
    //----add by Benny end----//

}
